package ObjectCompare;

import java.util.Comparator;

public class User {

    private Integer age;
    private String name;

    public User(Integer age, String name) {
        this.age = age;
        this.name = name;
    }

//    @Override
//    public int compareTo(User o) {
//        return this.age - o.age;
//    }


    public Integer getAge() {
        return age;
    }

    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return "User{" +
                "age=" + age +
                ", name='" + name + '\'' +
                '}';
    }
}
